﻿/*=========================== SOFTWARE LICENSE AGREEMENT ===========================
 
    Copyright (c) 2012, Rob Lammert Software
 
    This file is part of SharpLog.
    Author:  Rob Lammert <rob@roblammert.com>

    Foobar is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Foobar is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
  =================================================================================*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace com.roblammert.sharplog.Outputs
{
    /// <summary>
    /// ConsoleLogger is a Logger observer which writes the log messages to the console
    /// </summary>
    public class ConsoleLogger : ILogger
    {
        #region Constructor
		/// <summary>
		/// Initializes a new instance of the <see cref="com.roblammert.log.Outputs.DebugLogger"/> class.
		/// </summary>
        public ConsoleLogger()
        {

        }
        #endregion

        /// <summary>
        /// Write Log event to console
        /// </summary>
        /// <param name="eventTime">Date and time that the event took place</param>
        /// <param name="level">Severity Level of the event</param>
        /// <param name="facility">Facility of the event</param>
        /// <param name="method">Method that called the Logger class instance</param>
        /// <param name="logMessage">Message detailing the event</param>
        public void ProcessLogMessage(DateTime date, Logger.Severity level, Logger.Facility facility, String method, String message)
        {
            Console.WriteLine(date.ToString() + " - [" + level.ToString() + ":" + facility.ToString() + "] <" + method + "> " + message);
        }
    }
}
